package com.frxuexi.mine

import com.frxuexi.lib_base.entity.BaseEntity
import com.frxuexi.mine.entity.LeaveEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {

    @POST("/api/staff/save")
    fun register(@Body body: RequestBody):Flow<BaseEntity<Any>>

    @POST("/api/user/login")
    fun login(@Body body: RequestBody):Flow<BaseEntity<Any>>

    @POST("/api/leave/save")
    fun addLeave(@Body body: RequestBody):Flow<BaseEntity<Any>>

    @GET("/api/leave/all")
    fun getLeaves(@Query ("status") status:String):Flow<BaseEntity<List<LeaveEntity>>>

    /**
     * 审核请假
     */
    @POST("/api/leave/audit")
    fun comLeave(@Body body: RequestBody):Flow<BaseEntity<Any>>
}